<?php
/**
// +----------------------------------------------------------------------------------------
// | Icoterie Development Framework Intelligence Enterprise Management Priority Selective
// +----------------------------------------------------------------------------------------
// | Copyright (c) [2019] [Honor Full Epoch Educational Science Technology Hebei Co., Ltd.]
// | website  http://dev.icoterie.top http://www.ihfe.top
// +----------------------------------------------------------------------------------------
// | [Icoterie Development Framework] is licensed under the Mulan PSL v2.
// +----------------------------------------------------------------------------------------
// | You can use this software according to the terms and conditions of the Mulan PSL v2.
// +----------------------------------------------------------------------------------------
// | Licensed ( http://license.coscl.org.cn/MulanPSL2 )
// +----------------------------------------------------------------------------------------
// | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
// | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
// | FIT FOR A PARTICULAR PURPOSE.
// +----------------------------------------------------------------------------------------
// | See the Mulan PSL v2 for more details.
// +----------------------------------------------------------------------------------------
// | Author: Reflux Lewse,Red Shadow Sue
// +----------------------------------------------------------------------------------------
 */
namespace core\basic;

class Response
{
	/** 
	* 检测文件夹 
	* @param string	$d	文件夹路径(物理)
	* @param string	$c	是否创建
	* @echo string		错误提示
	*/ 
    public static function checkDir($d,$c=false)
    {
        if(is_dir($d) == false){
			if($c !== false){
				//mkdir(iconv("UTF-8", "GBK", $d),0755,true);
				mkdir($d,0755,true);
			}else{
				echo '目录' . $d . '不存在';
				exit;
			}
		}
		return $d;
    }
	/** 
	* 检测文件
	* @param string	$d	文件路径(物理)
	* @echo string		错误提示
	*/
    public static function checkFile($d)
    {
        if (file_exists($d) == false){
			echo '文件' . $d . '不存在';
			exit;
		}
		return $d;
    }
}